import { computed, getCurrentInstance } from "vue";

const useHookRouter = () => {
  const instance = getCurrentInstance()?.proxy as any;

  const currentPath = computed<string>(() => {
    return instance?.$route.path || "";
  });

  const breadcrumbList = computed(() => {
    return instance?.$route.meta.breadcrumbList || [];
  });

  return {
    $router: instance?.$router,
    $route: instance?.$route,
    currentPath,
    breadcrumbList,
  };
};

export default useHookRouter;
